/**
 * Created by john on 2018/11/4.
 */
/**
 * Created by john on 2018/3/28.
 */
var express = require('express');
var router = express.Router();
var VCode = require("../../config/code");
/*必须登录才能访问的api*/

router.use('/**', function(req, res, next) {
    if(req.session.userinfo){
        next();
    }else{
        res.send(VCode.login);
    }
});

router.get("/test",function (req, res, next) {
    var ret = {
        data:"测试需要登录的接口"
    }
    ret = Object.assign(ret,VCode.success);
    res.send(ret);
})

module.exports = router;
